﻿using System;

namespace Storyteller.Framework.Graphics.Particles.EmitModifiers
{
	public class RandomRotationEmitModifier : ParticleEmitModifier
	{
		public float MinimumRotation { get; set; }
		public float MaximumRotation { get; set; }

		public RandomRotationEmitModifier()
		{
			random = RandomUtil.Random;
		}

		public override void Process(Particle[] particles, int offset, int count)
		{
			for (int i = 0; i < count; i++)
			{
				particles[i + offset].Rotation = random.NextFloat(MinimumRotation, MaximumRotation);
			}
		}

		Random random;
	}
}
